<?php
/**
 * Created by PhpStorm.
 * User: zhenghao
 * Date: 2015/6/17
 * Time: 17:30
 */

require_once __DIR__."/../bo/SmsBO.php";


/**
 * Class SmsServer
 * 短信发送处理类
 */
class SmsServer extends Server {

    private $json_data=array("code" => 200,"msg" => "success");

    //向指定手机发送验证码
    function sendSecurityCode(){

        if(!isset($_REQUEST["phone"]) || empty($_REQUEST["phone"])) throw new Exception("phone is null");

        $phone=$_REQUEST["phone"];

        $s_code=SmsBO::sendCode($phone);

        $this->json_data["s_code"]=$s_code;

        $this->showJsonData($this->json_data);

    }



}